{% extends "transsys/base_transsys.html" %}
{%block center%}
<div class="edit_form"">
     <h2>Identify Attractors</h2>
    <fieldset><legend></legend>
        <form id="identify_attractors" action="identifyAttractors" method="post" class="edit">
            {% csrf_token %}
            <fieldset><legend></legend>
                <label>Number of time steps:</label>
                <span class="helptext">Enter number of time steps</span>
                <input type="text" name="timestep" value="{{input.timestep}}"/>
                <label>Number of simulations:</label>
                <span class="helptext">Enter number of simulations</span>
                <input type="text" name="no_simulations" value="{{input.no_simulations}}"/>
                <label>Initial expression level</label>
                <span class="helptext">Set the minimum and maximum of the randomly generated initial factor concentrations.</span>
                <div id="data_set">
                    <label>Min:</label>
                    <input type="text" name="c_min" value="{{input.c_min}}"/>
                    <label>Max:</label>
                    <input type="text" name="c_max" value="{{input.c_max}}"/>
                </div>
            </fieldset>

            <button type="submit" name="submit">Submit</button>
        </form>
    </fieldset>

    {% if fc_list %}
    <div class="hidden">
        <h2>Factor concentration table:</h2>
        <table id="fc_table">
            <colgroup>
                <col class="oce-first" />
            </colgroup>
            <tr>
                <th scope="col">Round</th>
                {% for f in request.session.ts_program.tp.factor_list %}
                <th scope="col" >{{f.name}}</th>
                {% endfor %}
            </tr>
            {% for fc in fc_list %}
            <tr>
                <td>{{forloop.counter}}</td>
                {% for c in fc %}
                <td>{{c}}</td>
                {% endfor %}
            </tr>
            {% endfor %}
        </table>
    </div>
    <div style="display: block;">
        <table class="center1">
            {% if factor_list %}
            {% else %}
                {% for f1 in request.session.ts_program.tp.factor_list %}
                    <tr>
                        {% for f2 in request.session.ts_program.tp.factor_list %}
                            {% if f1.name == f2.name %}
                                <td style="text-align:center;"><strong>{{f1.name}}</strong></td>
                            {% else %}
                            <td><a class="thumbnail" href="{% url ts.views.plotAttractors request.session.ts_program.tp.name f1.name f2.name 'full' %}"><img src="{% url ts.views.plotAttractors request.session.ts_program.tp.name f1.name f2.name 'thumbnail' %}" alt=""/></a></td>
                            {% endif %}
                        {% endfor %}
                    </tr>
                {% endfor %}
            {% endif %}
        </table>
        <a class="link-button" href="#" title="Download data as text format"> Download data </a>
    </div>
    {% endif %}

</div>
{% endblock %}